package com.simoniu.mp.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
public class Users implements Serializable,Cloneable {

    //自增策略
    /*
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY) //auto_increment类型
    @TableId(type = IdType.AUTO)
    */

    //MyBatis-Plus主键策略
    /*
    @Id
    @TableId(type = IdType.ASSIGN_ID)
    private Long uid;
    */

    //主键是字符串类型
    /*
    @Id
    @TableId(type = IdType.ASSIGN_UUID)
    private String uid;
    */

    //使用自定义的输入策略
    /*
    @Id
    @TableId(type = IdType.INPUT)
    private String uid;
    */

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY) //auto_increment类型
    @TableId(type = IdType.AUTO)

    private Integer uid;
    private String username;

    private String password;
    private String gender;
    private String email;
    private String address;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
